import requests
import homesite.keys as st
def send_weixin(content):
    url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="+ st.WE_CHAT_BOT_KEY # 这里就是群机器人的Webhook地址
    headers = {"Content-Type": "application/json"} # http数据头，类型为json
    data = {
        "msgtype": "text",
        "text": {
            "content": content, # 让群机器人发送的消息内容。
            "mentioned_list": [],
        }
    }
    r = requests.post(url, headers=headers, json=data) # 利用requests库发送post请求
